import Cookies from 'js-cookie'

const Token = 'token'
const Routes = 'routes'
export function getToken() {
    return Cookies.get(Token)
}

export function setToken(val) {
    return Cookies.set(Token, val)
}

export function removeToken() {
    return Cookies.remove(Token)
}

export function getRoutes() {
    if (Cookies.get(Routes) == undefined) {
        return [{path:'/layout/home',query:{title:'首页'}}]
    } else {
        return JSON.parse(Cookies.get(Routes))
    }
}
export function setRoutes(val) {
    return Cookies.set(Routes, val)
}